package app.fugema.shop.main.invoice.model;

import com.base.common.utils.DateUtils;
import com.base.common.utils.UIUtils;
import com.rex.editor.common.Utils;

import java.util.Arrays;
import java.util.List;

public class ConsultListBean {

    /**
     * code : 0
     * msg : 成功
     * data : [{"id":100000,"online":0,"category":"贵宾犬1","title":"两天呕吐不止1","content":"<p>前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上sssssssssss<\/p>","pic":"https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c6a891b2718d404a9d973fdbfeb97452.jpg,https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c48da64fe33c4008b35fb8a94cd82bd8.jpg","tnqq":0,"twqq":0,"vaccine":0,"state":0,"createTime":"2021-01-13 17:00:17","creator":10000,"avatar":null,"realname":null},{"id":100001,"online":1,"category":"博美","title":"两天呕吐不止","content":"前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上","pic":"https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c6a891b2718d404a9d973fdbfeb97452.jpg,https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c48da64fe33c4008b35fb8a94cd82bd8.jpg","tnqq":1,"twqq":0,"vaccine":0,"state":1,"createTime":"2021-01-13 17:00:17","creator":10000,"avatar":null,"realname":null}]
     */

    private int code;
    private String msg;
    private List<DataBean> data;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public List<DataBean> getData() {
        return data;
    }

    public void setData(List<DataBean> data) {
        this.data = data;
    }

    public static class DataBean {
        /**
         * id : 100000
         * online : 0
         * category : 贵宾犬1
         * title : 两天呕吐不止1
         * content : <p>前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上前天晚上sssssssssss</p>
         * pic : https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c6a891b2718d404a9d973fdbfeb97452.jpg,https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c48da64fe33c4008b35fb8a94cd82bd8.jpg
         * tnqq : 0
         * twqq : 0
         * vaccine : 0
         * state : 0
         * createTime : 2021-01-13 17:00:17
         * creator : 10000
         * avatar : null
         * realname : null
         * <p>
         * <p>
         * <p>
         *        avatar	头像	string
         *        category	宠物种类	string
         *        content	描述	string
         *        createTime	发布时间	string(date-time)
         *        creator	发布人	integer(int32)
         *        id	问诊id	integer(int64)
         *        online	0不在线1在线	integer(int32)
         *        pic	图片	string
         *        realname	姓名	string
         *        state	状态，0未解决1已解决	integer(int32)
         *        title	标题，病情简介	string
         * <p>
         *        tnqq	是否体内驱虫，0否1是	integer(int32)
         *        twqq	是否体外驱虫，0否1是	integer(int32)
         *        vaccine	是否打过疫苗，0否1是
         */

        private int id;
        private int online;
        private String category;
        private String title;
        private String content;
        private String pic;
        private int tnqq;
        private int twqq;
        private int vaccine;
        private int state; //状态，0未解决1已解决
        private String createTime;
        private int creator;
        private String avatar;
        private String realname;


        private int doctorId;
        private String doctorAvatar;
        private String doctorRealname;


        private DoctorBean doctor;

        public String getPic() {
            if (UIUtils.isEmpty(pic)) {
                return null;
            } else if (pic.contains(",")) {
                return pic.split(",")[0];
            }
            return pic;
        }

        public List<String> getListPic() {
            if (UIUtils.isEmpty(pic)) {
                return null;
            } else {
                return Arrays.asList(pic.split(","));
            }
        }

        public String getContent() {
            return Utils.getHtml2Text(content);
//            return content;
        }


        public String getTime() {
            String date = DateUtils.dateStringToString(createTime, DateUtils.simpleFormat);
            String tody = DateUtils.getNowDateString_simple();
            if (tody.equals(date)) {
                return "今天";
            }
            return DateUtils.dateStringToString(createTime, "MM-dd HH:mm");
        }


        public DoctorBean getDoctor() {
            return doctor;
        }

        public void setDoctor(DoctorBean doctor) {
            this.doctor = doctor;
        }

        public int getDoctorId() {
            return doctorId;
        }

        public void setDoctorId(int doctorId) {
            this.doctorId = doctorId;
        }

        public String getDoctorAvatar() {
            return doctorAvatar;
        }

        public void setDoctorAvatar(String doctorAvatar) {
            this.doctorAvatar = doctorAvatar;
        }

        public String getDoctorRealname() {
            return doctorRealname;
        }

        public void setDoctorRealname(String doctorRealname) {
            this.doctorRealname = doctorRealname;
        }

        public int getId() {
            return id;
        }

        public void setId(int id) {
            this.id = id;
        }

        public int getOnline() {
            return online;
        }

        public void setOnline(int online) {
            this.online = online;
        }

        public String getCategory() {
            return category;
        }

        public void setCategory(String category) {
            this.category = category;
        }

        public String getTitle() {
            return title;
        }

        public void setTitle(String title) {
            this.title = title;
        }


        public void setContent(String content) {
            this.content = content;
        }


        public void setPic(String pic) {
            this.pic = pic;
        }

        public int getTnqq() {
            return tnqq;
        }

        public void setTnqq(int tnqq) {
            this.tnqq = tnqq;
        }

        public int getTwqq() {
            return twqq;
        }

        public void setTwqq(int twqq) {
            this.twqq = twqq;
        }

        public int getVaccine() {
            return vaccine;
        }

        public void setVaccine(int vaccine) {
            this.vaccine = vaccine;
        }

        public int getState() {
            return state;
        }

        public void setState(int state) {
            this.state = state;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public int getCreator() {
            return creator;
        }

        public void setCreator(int creator) {
            this.creator = creator;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public String getRealname() {
            return realname;
        }

        public void setRealname(String realname) {
            this.realname = realname;
        }
    }

    public static class DoctorBean {
        /**
         * userId : 3
         * realname : 李琦
         * avatar : https://qiuzy.oss-cn-shenzhen.aliyuncs.com/app/20191126/c6a891b2718d404a9d973fdbfeb97452.jpg
         * workYear : 0
         * pets : 爱尔兰
         * answerNumber : 0
         * rewardNumber : 0
         * merit : 优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显优势很明显
         * createTime : 2021-04-01 09:15:43
         * creator : 1
         */

        private int userId;
        private String realname;
        private String avatar;
        private int workYear;
        private String pets;
        private int answerNumber;
        private int rewardNumber;
        private String merit;
        private String createTime;
        private int creator;

        public int getUserId() {
            return userId;
        }

        public void setUserId(int userId) {
            this.userId = userId;
        }

        public String getRealname() {
            return realname;
        }

        public void setRealname(String realname) {
            this.realname = realname;
        }

        public String getAvatar() {
            return avatar;
        }

        public void setAvatar(String avatar) {
            this.avatar = avatar;
        }

        public int getWorkYear() {
            return workYear;
        }

        public void setWorkYear(int workYear) {
            this.workYear = workYear;
        }

        public String getPets() {
            return pets;
        }

        public void setPets(String pets) {
            this.pets = pets;
        }

        public int getAnswerNumber() {
            return answerNumber;
        }

        public void setAnswerNumber(int answerNumber) {
            this.answerNumber = answerNumber;
        }

        public int getRewardNumber() {
            return rewardNumber;
        }

        public void setRewardNumber(int rewardNumber) {
            this.rewardNumber = rewardNumber;
        }

        public String getMerit() {
            return merit;
        }

        public void setMerit(String merit) {
            this.merit = merit;
        }

        public String getCreateTime() {
            return createTime;
        }

        public void setCreateTime(String createTime) {
            this.createTime = createTime;
        }

        public int getCreator() {
            return creator;
        }

        public void setCreator(int creator) {
            this.creator = creator;
        }
    }
}
